package com.zy.controller;

import com.zy.entity.JsonResult;
import com.zy.entity.Notice;
import com.zy.mapper.NoticeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/app")
public class NoticeController {
    @Autowired
    private NoticeMapper noticeMapper;

    /**
     * 系统公告
     *
     * @return com.zy.entity.JsonResult
     * @author 小宁
     * @date 2021-04-06 11:06
     */
    @GetMapping("/getNotice")
    @ResponseBody
    public JsonResult getNotice() {
        List<Notice> noticeList = noticeMapper.getNoticeList();
        return new JsonResult("200", "", noticeList);
    }
}
